<?php

require "../PHPUnit_Framework_TestCase.php";
require "../MyGreeter.php";

class MyGreeter_Client_Test extends \PHPUnit_Framework_TestCase
{
    var $greeter;


    public function setUp()
    {
        $MyGreeter = new MyGreeter();
        $this->greeter = $MyGreeter->Client();


    }

    public function test_Instance()
    {

        $this->assertEquals(
            get_class($this->greeter),
            'MyGreeter\Client'
        );
    }

    public function test_getGreeting()
    {

        $this->assertTrue(
            strlen($this->getGreeting()) > 0
        );
    }


    //变量赋值
    public function getGreeting()
    {
        $this->greeter = 'greeter';
    }

}

//实例化
$test=new MyGreeter_Client_Test();

$test->setUp();
$test->test_Instance();
$test->test_getGreeting();

